<template>
  <el-container>
    <el-main>
      <el-empty v-if="isempty" description="暂未发布签到"></el-empty>
      <PublishSign @SignDel="delPublish" v-for="item in signList" :key="item.id" :sign="item" @getNew="getNew"></PublishSign>
    </el-main>
  </el-container>
</template>

<script>
import { getCreateSign } from '@/utils/api/sign'
import PublishSign from './PublishSign.vue'
export default {
  name: 'Sign',
  props: {},
  components: {
    PublishSign
  },
  data () {
    return {
      signList: null,
      SignIf: true,
      isempty: true
    }
  },

  created () {
    this.getSign()
  },
  methods: {
    getSign () {
      getCreateSign().then(res => {
        this.signList = res.data.data
        if (this.signList.length) {
          this.isempty = false
        } else {
          this.isempty = true
        }
      })
    },
    delPublish (val) {
      this.SignIf = val
    },
    getNew () {
      this.getSign()
    }
  }
}
</script>

<style lang="less" scoped></style>
